home *** CD-ROM | disk | FTP | other *** search
/ Champak 40 / Vol 40.iso / games / bee_dodg.swf / scripts / frame_1 / DoAction.as < prev   
Encoding:
Text File  |  2007-05-10  |  1.8 KB  |  80 lines

  1. function starMove()
  2. {
  3.    this.xspd -= 0.6;
  4.    this.yspd -= 0.6;
  5.    this.starscale *= 1.05;
  6.    this._x += this.xspd;
  7.    this._y += this.yspd;
  8.    this._xscale = this.starscale;
  9.    this._yscale = this.starscale;
  10.    this._y >= -50 ? null : this.removeMovieClip();
  11. }
  12. function burstt(a, d, c)
  13. {
  14.    k = 0;
  15.    while(k < 15)
  16.    {
  17.       curStar = attachMovie("bstar","cstar" + i,i);
  18.       i++;
  19.       i <= 1000 ? null : (i = 0);
  20.       curStar.gotoAndStop(random(c) + 1);
  21.       c != 10 ? null : curStar.gotoAndStop(random(2) + 4);
  22.       curStar._xscale = 50 + random(101);
  23.       curStar._yscale = curStar._xscale;
  24.       curStar._x = a;
  25.       curStar._y = d;
  26.       curStar.xspd = Math.random() * 10 - 5;
  27.       curStar.yspd = Math.random() * 10 - 3;
  28.       curStar.grav = 0.5;
  29.       curStar.onEnterFrame = Move;
  30.       k++;
  31.    }
  32. }
  33. function Move()
  34. {
  35.    if(_currentframe == 6)
  36.    {
  37.       this.removeMovieClip();
  38.    }
  39.    this._x += this.xspd;
  40.    this._y -= this.yspd;
  41.    this.yspd -= this.grav;
  42.    if(this._y > 450)
  43.    {
  44.       this.removeMovieClip;
  45.    }
  46. }
  47. xspd;
  48. yspd;
  49. starscale;
  50. i = 0;
  51. burstCounter = 0;
  52. onMouseDown = function()
  53. {
  54.    if(_currentframe != 6 && burstCounter <= 0)
  55.    {
  56.       burstt(_root._xmouse,_root._ymouse,random(6));
  57.       burstCounter = 15;
  58.    }
  59.    if(_root.soundMC.hitTest(_root._xmouse,_root._ymouse,true))
  60.    {
  61.       _root.soundMC.play();
  62.    }
  63. };
  64. onEnterFrame = function()
  65. {
  66.    burstCounter--;
  67.    if(_currentframe == 1)
  68.    {
  69.       curstar = attachMovie("star","star" + i,i);
  70.       i++;
  71.       i <= 1000 ? null : (i = 0);
  72.       curstar._x = bee._x + 5;
  73.       curstar._y = bee._y + 5;
  74.       curstar.xspd = -1 - Math.random() * 3;
  75.       curstar.yspd = -1.2 - Math.random() * 3;
  76.       curstar.starscale = 50;
  77.       curstar.onEnterFrame = starMove;
  78.    }
  79. };
  80.